package com.atguigu.gmall;

import com.atguigu.gmall.common.constant.RedisConst;
import org.redisson.api.RBloomFilter;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * @author XIN
 * 2023/4/16
 */
@SpringBootApplication
@EnableDiscoveryClient
public class ProductApp implements CommandLineRunner {
	public static void main(String[] args) {
		SpringApplication.run(ProductApp.class, args);
	}
	@Autowired
	private RedissonClient redissonClient;
	
	
	@Override
	public void run(String... args) throws Exception {
		System.out.println("spring启动完成了");
		RBloomFilter<Long> bloomFilter = redissonClient.getBloomFilter(RedisConst.SKU_BLOOM_FILTER);
		bloomFilter.tryInit(100000,0.03);
	}
}
